#if the pkg created in packages-woof has something wrong, this file is a last
#resort to fix it. Current-dir is where this file FIXUPHACK is located.

[ -f usr/bin/X ] && mv usr/bin/X usr/bin/X-ORIG
ln -s Xorg usr/bin/X

#ln -s ../../../etc/X11/xkb usr/share/X11/xkb

#100416 restore...
##remove GL stuff to save space...
#rm -rf usr/lib/dri
#rm -f usr/lib/libEGL.so* 2>/dev/null
#rm -f usr/lib/libGL*

#100328 if building xorg 7.3, need a different /etc/X11/xorg.conf0...
#...no, will do it in xorgwizard.

#100416 ubuntu lucid has moved libGL.so* to /usr/lib/mesa (why oh why!!!???)...
#note, but not libGLU.so*
if [ -e usr/lib/mesa/libGL.so.1 ];then
 ln -s mesa/libGL.so.1 usr/lib/libGL.so.1
 ln -s mesa/libGL.so usr/lib/libGL.so
 ln -s mesa/libGL.so.1.2 usr/lib/libGL.so.1.2
fi

#120406 gxmessage pkg creates xmessage symlink to it (in pinstall.sh). get real xmessage out of the way...
if [ -f usr/bin/xmessage ];then
 if [ ! -h usr/bin/xmessage  ];then
  mkdir -p usr/local/bin
  mv -f usr/bin/xmessage usr/local/bin/
 fi
fi

#if /etc/fonts/fonts.conf is not present, use traditional Puppy-style font settings
if [ -f etc/fonts/fonts.conf ];then
 rm -rf etc/fonts-puppy
else
 rm -rf etc/fonts
 mv etc/fonts-puppy etc/fonts
fi

#delete xcalc.desktop if xcalc not installed
[ -x usr/bin/xcalc ] || rm usr/share/applications/Xcalc*
